home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_horuswhip.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  245 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_HorusWhip.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.     
  12.     message     startup
  13.     message     damaged
  14.     message     entered
  15.         
  16.     thing       player      local
  17.     thing       indy        local       # actor
  18.     thing       bird                    # strut
  19.     thing       whipCam1
  20.     thing       whipCam2
  21.     thing       target1
  22.     thing       crate
  23.     
  24.     thing       splash1
  25.     thing       splash2
  26.     thing       splash3
  27.     
  28.     sector      inside
  29.     sector      waterfall
  30.     
  31.     sector      watSec0
  32.     sector      watSec1
  33.     sector      watSec2
  34.     
  35.     surface     floor1
  36.     surface     floor2
  37.     
  38.     template    tplActor=indy_sh_actor              local
  39.     
  40.     material    mat0=riv_a4sprite_rocksplash_b.mat  local
  41.     
  42.     sound       mus_Cue=mus_pyr_shinyobject.wav     local
  43.     sound       sfx_Splash=fol_in_enterwater.wav    local
  44.     
  45.     int         gemRoom=0       local
  46.     int         onCrate=1       local
  47.     int         animTrack       local
  48.     int         played=0        local
  49.     
  50. end
  51.  
  52.  
  53. # ========================================================================================
  54.  
  55. code
  56.  
  57. startup:
  58.  
  59.     # hide splashes at startup
  60.     SetThingFlags(splash1, 0x10);
  61.     SetThingFlags(splash2, 0x10);
  62.     SetThingFlags(splash3, 0x10);
  63.     return;
  64.  
  65. # ========================================================================================
  66.  
  67. damaged:
  68.  
  69.     player = GetLocalPlayerThing();
  70.     
  71.     if(GetParam(1) == 0x10)
  72.     {
  73.         # from crate to pyramid room
  74.         if(onCrate == 1)
  75.         {
  76.             onCrate = 0;
  77.             
  78.             # do cutscene stuff
  79.             StartCutscene(0);
  80.             SetActorFlags(player, 0x200000);
  81.             
  82.             # switch to whipCam1
  83.             SetCameraFocus(2, whipCam1);
  84.             SetCameraSecondaryFocus(2, player);
  85.             SetCurrentCamera(2);
  86.             SetCameraFOV(90, 0, 0.0);
  87.             
  88.             Sleep(2.8);
  89.             
  90.             Print("splash1");
  91.             # show water splash and play sfx
  92.             PlaySoundThing(sfx_Splash, splash1, 1.0, 8.0, 16.0, 0x0);
  93.             ClearThingFlags(splash1, 0x10);
  94.             SetMaterialCel(mat0, 0);
  95.             animTrack = MaterialAnim(mat0, 10.0, 1);
  96.             
  97.             Sleep(0.5);
  98.             SetThingFlags(splash1, 0x10);
  99.             StopAnim(animTrack);
  100.         }
  101.             
  102.         # from pyramid room to crate
  103.         else if(onCrate == 0)
  104.         {
  105.             # do cutscene stuff
  106.             StartCutscene(0);
  107.             SetActorFlags(player, 0x200000);
  108.             
  109.             # switch to whipCam1
  110.             SetCameraFocus(2, whipCam1);
  111.             SetCameraSecondaryFocus(2, player);
  112.             SetCurrentCamera(2);
  113.             SetCameraFOV(90, 0, 0.0);
  114.             
  115.             # turn off water sectors
  116.             ClearSectorFlags(watSec0, 0x2);
  117.             ClearSectorFlags(watSec1, 0x2);
  118.             ClearSectorFlags(watSec2, 0x2);
  119.             
  120.             Sleep(1.5);
  121.             Print("splash3");
  122.             # show water splash and play sfx
  123.             PlaySoundThing(sfx_Splash, splash3, 1.0, 8.0, 16.0, 0x0);
  124.             ClearThingFlags(splash3, 0x10);
  125.             SetMaterialCel(mat0, 0);
  126.             animTrack = MaterialAnim(mat0, 10.0, 1);
  127.             
  128.             Sleep(0.5);
  129.             SetThingFlags(splash3, 0x10);
  130.             StopAnim(animTrack);
  131.             
  132.             Sleep(0.5);
  133.             Print("splash1 tim");
  134.             # show water splash and play sfx
  135.             PlaySoundThing(sfx_Splash, splash1, 1.0, 8.0, 16.0, 0x0);
  136.             ClearThingFlags(splash1, 0x10);
  137.             SetMaterialCel(mat0, 0);
  138.             animTrack = MaterialAnim(mat0, 10.0, 1);
  139.             
  140.             Sleep(0.5);
  141.             SetThingFlags(splash1, 0x10);
  142.             StopAnim(animTrack);
  143.             
  144.             # Reset the camera
  145.             SetCameraPosition(1, GetThingPos(whipCam1));
  146.             SetCurrentCamera(1);
  147.             
  148.             # restore controls
  149.             ClearActorFlags(player, 0x200000);
  150.             EndCutscene();
  151.         }
  152.     }
  153.                 
  154.     return;
  155.  
  156. # ========================================================================================
  157.  
  158. entered:
  159.  
  160.     player = GetLocalPlayerThing();
  161.     
  162.     if(gemRoom == 0)
  163.     {
  164.         if(GetSenderRef() == waterfall)
  165.         {
  166.             # switch to whipCam2 inside key room
  167.             SetCameraFocus(2, whipCam2);
  168.             SetCameraSecondaryFocus(2, player);
  169.             SetCurrentCamera(2);
  170.             SetCameraFOV(90, 0, 0.0);
  171.             
  172.             # show water splash and play sfx
  173.             Print("splash2");
  174.             PlaySoundThing(sfx_Splash, splash2, 1.0, 8.0, 16.0, 0x0);
  175.             ClearThingFlags(splash2, 0x10);
  176.             SetMaterialCel(mat0, 0);
  177.             animTrack = MaterialAnim(mat0, 10.0, 1);
  178.             
  179.             Sleep(0.5);
  180.             SetThingFlags(splash2, 0x10);
  181.             StopAnim(animTrack);
  182.         }
  183.         
  184.         else if((GetSenderRef() == floor1) || (GetSenderRef() == floor2))
  185.         {
  186.             gemRoom = 1;
  187.             
  188.             # turn on water sectors
  189.             SetSectorFlags(watSec0, 0x2);
  190.             SetSectorFlags(watSec1, 0x2);
  191.             SetSectorFlags(watSec2, 0x2);
  192.             
  193.             # hide player and create actor
  194.             indy = CreateThing(tplActor, player);
  195.             CaptureThing(indy);
  196.             CopyPlayerHolsters(player, indy);
  197.             SetThingFlags(player, 0x80000);
  198.             ClearThingFlags(indy, 0x80000);
  199.             SetCameraSecondaryFocus(2, indy);
  200.             
  201.             # actor takes a step forward
  202.             AISetMoveSpeed(indy, 1.0);
  203.             AISetLookThing(indy, target1);
  204.             AISetMoveThing(indy, target1, 1);
  205.             #Sleep(1.0);
  206.             
  207.             # Get the player into position
  208.             CopyOrientAndPos(indy, player);
  209.             SetThingFlags(indy, 0x80000);
  210.             ClearThingFlags(player, 0x80000);
  211.             ClearActorFlags(player, 0x200000);
  212.             
  213.             # Reset the camera
  214.             SetCameraPosition(1, GetThingPos(whipCam2));
  215.             SetCurrentCamera(1);
  216.             EndCutscene();
  217.             
  218.             # play music cue
  219.             if(played == 0)
  220.             {
  221.                 played = 1;
  222.                 PlaySoundLocal(mus_Cue, 1.0, 0.0, 0x0, 0);
  223.             }
  224.         }
  225.     }
  226.         
  227.     else if(GetSenderRef() == crate)
  228.     {
  229.         # turn on water sectors
  230.         SetSectorFlags(watSec0, 0x2);
  231.         SetSectorFlags(watSec1, 0x2);
  232.         SetSectorFlags(watSec2, 0x2);
  233.             
  234.         onCrate = 1;
  235.         gemRoom = 0;
  236.     }
  237.     
  238.     return;
  239.                
  240. # ========================================================================================
  241.  
  242.  
  243. end
  244.  
  245.